/**
 * Created by Administrator on 2018/12/25.
 */
import global from './global'
const myFilters = {
  imgListPathFilter: function (imglist) {
    var newImgList = [];
    for (let img of imglist) {
      var str = new RegExp("http");
      var result = str.test(img);
      if (result) {
        newImgList.push(img)
      } else {
        newImgList.push(global.ImgBaseURL + '/' + img)
      }
    }
    console.log(newImgList);
    return newImgList;
  },
  imgPathFilter: function (img) {
    if (img) {
      var str = new RegExp("http");
      var result = str.test(img);
      if (result) {
        return img;
      } else {
        return global.ImgBaseURL + '/' + img;
      }
    }
    return "";
  }
};

export default myFilters;


